<template>
  <div class="vocation-container">
    <el-table
        :border="true"
        :data="activityLeaveList"
        highlight-current-row
        max-height="680"
        style="width: 100%"
    >
      <el-table-column label="序号" type="index" width="50"></el-table-column>
      <el-table-column
          label="请假时间"
          prop="activityleaveDatetime"
      />
      <el-table-column
          label="请假理由"
          prop="activityleaveReason"
      />
      <el-table-column
          label="姓名"
          prop="volunteerId"
      >

      </el-table-column>
    </el-table>
    <el-pagination
        :current-page="currentPage"
        :page-size="currentPageSize"
        :page-sizes="[10,50,100,500,1000,99999]"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleGetBySizeActivity"
        @current-change="handleGetByNumActivity"/>

  </div>
</template>

<script>
export default {
  data () {
    return {
      activityLeaveList: [],
      currentPage: 1,
      currentPageSize: 10,
      total: 0,
      reasonShow: false,
    };
  },
  mounted () {
    this.handleGetActivityLeaveInfo();
  },
  methods: {
    // 分页查询全部待审核活动
    async handleGetActivityLeaveInfo () {
      const res = await this.$http.manager_getToAuditActivityLeave({
        pageNum: this.currentPage,
        pageSize: this.currentPageSize,
      });
      if (res.code !== 0) return null;
      console.log(res);
      this.activityLeaveList = res.data.list;
      this.total = res.data.totalCount;
    },
    async handleGetBySizeActivity (size) {

      this.currentPageSize = size;
      await this.handleGetActivityLeaveInfo();
    },

    async handleGetActivityInfo (params) {
      this.articleContentshow = true;
      let res = await this.$http.handleGetActivityLeaveInfo(params);
      if (res.code !== 0) return null;
      this.content = res.data;
      // console.log(this.content)
    },
    // 分页查询全部活动
    async handleGetByNumActivity (num) {
      this.currentPage = num;
      await this.handleGetActivityLeaveInfo();

    },
  },
};
</script>
